package vg.services.graph_view_manager.realization.graph_view.smart_graph_view.realization.actions;

import vg.services.graph_view_manager.interfaces.graph_view.IGraphRenderer;

/**
 * Zoom in/ zoom out actions.
 *
 * @author Timur Zolotuhin (e-mail: tzolotuhin@gmail.com)
 */
public class ZoomAction extends DefaultActionAdapter {
    // zoom in action
    public static final int ZOOM_IN_ACTION = 1;
    // zoom out action
    public static final int ZOOM_OUT_ACTION = 2;

    // Main data
    private int action;

    public ZoomAction(int action) {
        super("zoom in / zoom out");

        this.action = action;
    }

    @Override
    public void action(final IGraphRenderer graphRenderer) {
        switch (action) {
            case ZOOM_IN_ACTION:
                graphRenderer.zoomIn();
                break;
            case ZOOM_OUT_ACTION:
                graphRenderer.zoomOut();
                break;
            default:
                break;
        }
    }
}
